﻿using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;

namespace _5E.WebInfrastructure.Json
{
    public class JsonHelper
    {
        public static string ToJson(dynamic dynamicObject)
        {
            return JsonConvert.SerializeObject(dynamicObject);
        }

        public static string ToCamelCasePropertyNameJson(dynamic dynamicObject)
        {
            return JsonConvert.SerializeObject(dynamicObject, Formatting.Indented,
                new JsonSerializerSettings { ContractResolver = new CamelCasePropertyNamesContractResolver() });
        }
    }
}
